package com.wl.java_spring_boot01.modules.account.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

/**
 * @author 汪林
 * @date 2020/8/21 11:23
 */
@Repository
@Mapper
public interface UserRoleDao {
    //userId删除
    @Delete("delete from user_role where user_id = #{userId}")
    void deleteUserRoleByUserId(int userId);

    @Insert("insert into user_role (user_id, role_id) " +
            "values (#{userId}, #{roleId})")
    void insertUserRole(int userId, int roleId);

    //roleId删除
    @Delete("delete from user_role where role_id = #{roleId}")
    void deleteUserRoleByRoleId(int roleId);
}
